2fe94639f782b54548715a394d923e7f2561aa5a,src/Grepolis/IO/Loader.java,Loader,loadDocksTroops,#,303

Before Change


    public static void loadDocksTroops() {
        BufferedReader reader = null;

        CodeSource codeSource = GrepolisBot.class.getProtectionDomain().getCodeSource();
        File jarFile = null;
        try {
            jarFile = new File(codeSource.getLocation().toURI().getPath());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
        String jarDir = null;
        if (jarFile != null) {
            jarDir = jarFile.getParentFile().getPath();
        }
        String fileName = jarDir + File.separator + "Saves" + File.separator + "DocksSave.txt";
        try {
            reader = new BufferedReader(new FileReader(fileName));
        } catch (Exception ignored) {/*Error checked inside of loadAccount with creating an account.*/}
        String line;

        try {
            if (reader != null) {
                while ((line = reader.readLine()) != null) {
                    String text[] = line.split(",");
                    ArrayList<Town> towns = Grepolis.GrepolisBot.getTowns();
                    Town town;
                    Docks docks = null;
                    for (String string : text) {

After Change


    }

    public static void loadDocksTroops(String directory) {
        BufferedReader reader = getBufferedReader(directory, "DocksSave.txt");
        String line;

        try {
            if (reader != null) {
                while ((line = reader.readLine()) != null) {
                    String text[] = line.split(",");
                    ArrayList<Town> towns;
                    if (directory.equals("Saves")) {
                        towns = Grepolis.GrepolisBot.getTowns();
                    } else {
                        towns = QueuePanel.getTemplateTowns();
                    }
                    Town town;
                    Docks docks = null;